package com.bdc.whatwhat.modele;

/**
 * Created by kevin on 21/06/14.
 */
public class Whatter {

    private String id;
    private String nom;
    private String prenom;
    private String urlImage;
    private String urlBanner;
    private WhatWhat whatWhat;

    private Integer niveau;
    private Long xpActuel = Long.valueOf(0);
    private Long xpMax = Long.valueOf(0);

    private boolean ami = false;
    private boolean demande = false;

    public Whatter(){}

    public Whatter(String id, String nom, String prenom, String urlImage) {
        this.id = id;
        this.nom = nom;
        this.prenom = prenom;
        this.urlImage = urlImage;
    }

    public Whatter(String id, String nom, String prenom, String urlImage, String urlBanner, WhatWhat whatWhat) {
        this.id = id;
        this.nom = nom;
        this.prenom = prenom;
        this.urlImage = urlImage;
        this.whatWhat = whatWhat;
        this.urlBanner = urlBanner;
    }

    public void setProfil(Whatter whatter){
        this.id = whatter.id;
        this.nom = whatter.nom;
        this.prenom = whatter.prenom;
        this.urlImage = whatter.urlImage;
        this.urlBanner = whatter.urlBanner;
        this.whatWhat = whatter.whatWhat;
    }

    public String getUrlBanner() {
        return urlBanner;
    }

    public void setUrlBanner(String urlBanner) {
        this.urlBanner = urlBanner;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getUrlImage() {
        return urlImage;
    }

    public void setUrlImage(String urlImage) {
        this.urlImage = urlImage;
    }

    public WhatWhat getWhatWhat() {
        return whatWhat;
    }

    public void setWhatWhat(WhatWhat whatWhat) {
        this.whatWhat = whatWhat;
    }

    public Integer getNiveau() {
        return niveau;
    }

    public void setNiveau(Integer niveau) {
        this.niveau = niveau;
    }

    public Long getXpActuel() {
        return xpActuel;
    }

    public void setXpActuel(Long xpActuel) {
        this.xpActuel = xpActuel;
    }

    public Long getXpMax() {
        return xpMax;
    }

    public void setXpMax(Long xpMax) {
        this.xpMax = xpMax;
    }

    public Float getXpPourcentage(){
        if(this.xpMax != 0)
            return Float.valueOf(this.xpActuel*1.0f / this.xpMax*1.0f);
        else
            return Float.valueOf(0);
    }

    public boolean isAmi() {
        return ami;
    }

    public void setAmi(boolean ami) {
        this.ami = ami;
    }

    public boolean isDemande() {
        return demande;
    }

    public void setDemande(boolean demande) {
        this.demande = demande;
    }

    @Override
    public String toString() {
        return "Whatter{" +
                "id='" + id + '\'' +
                ", nom='" + nom + '\'' +
                ", prenom='" + prenom + '\'' +
                ", urlImage='" + urlImage + '\'' +
                ", urlBanner='" + urlBanner + '\'' +
                ", whatWhat=" + whatWhat +
                ", niveau=" + niveau +
                ", xpActuel=" + xpActuel +
                ", xpMax=" + xpMax +
                '}';
    }
}
